Chapter 1
Chapter 2: 
Concatenation
Variables
Arithmetic expressions
Data types
Data conversion 
Scanner class

String is not included for the quiz.

- 1st year anniversary: vibe coding (Claude code, Codex, Replit, ...)
OpenClaw (GitHub) + Moltbook

- Second parameter of substring is exclusive 
str.substring(idx1, idx2) // characters stored at indexes idx1 through idx2 - 1

- String is not mutable (immutable)
Mutable equivalent of String in Java: StringBuilder
first.toUpperCase()

- compareTo(): int
< 0: I am smaller
0: We are equal
> 0: I am bigger

String str1 = "able";
String str2 = "bake"

str1.compareTo(str2); // < 0

str2 = "Bake";
str1.compareTo(str2); // > 0

How do we define our own ordering rules? This involves using special interfaces + lambdas

- replace: 

String first = "Wissam";
String firstModified = first.replace('s', 'S');
System.out.println("First modified: " + firstModified); // WiSSam

Example#1: StringMethods.java

- Random: java.util
discrete {1, 2, 3, 4, 5, 6}
continuous space of values in the case temperature

nextFloat()
nextInt()
nextInt(int upper): a random int value between 0 and upper - 1

Example#2: RandomDemo.java

[lower; upper]: int values

rnd.nextInt(a) + b ---> {0, ..., a - 1} + b ---> {b, ..., b + a - 1}

b = lower
b + a - 1 = upper ==> a = upper - b + 1

In the case of dice, lower = 1 and upper = 6
b = 1; a = 6

Random: Pseudo-random number generator

Random rnd = new Random();
rnd.nextFloat() // gives us a random floating point value between 0.0 (inclusive) and 1.0 (exclusive)

(int) rnd.nextFloat() * a + b ---> rnd int value between 1 (inclusive) and 6 (inclusive)
a = 6
b = 1

nextInt() ---> min integer value (Integer.MIN_VALUE) and max integer value (Integer.MAX_VALUE)
Use nextInt() to generate a random int value between 1 and 6

Hint: 
Math.abs(a) % b ----> [0; b-1[ int

Math.abs(rnd.nextInt()) % 6 + 1

Any App: - UI - business logic - data

NextJS ---> Web apps






























